﻿<UserControl x:Class="Tisbi.LawFirm.UI.Views.Controls.Forms.CasesCRUDForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d" 
             d:DesignHeight="132" d:DesignWidth="410">
    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="170" />
                <ColumnDefinition Width="Auto" MinWidth="240" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Label HorizontalAlignment="Right" VerticalAlignment="Center" Content="ID:" Grid.Row="0" Grid.Column="0"  />
            <Label HorizontalAlignment="Right" VerticalAlignment="Center" Content="Название дела:" Grid.Row="1" Grid.Column="0" />
            <Label HorizontalAlignment="Right" VerticalAlignment="Center" Content="Ответственный сотрудник:" Grid.Row="2" Grid.Column="0" />

            <!-- Bind controls to Model properties -->
            <TextBox Text="{Binding Path=Model.Id}" 
                     Grid.Column="1" Grid.Row="0"
                     IsReadOnly="True" Background="LightGray" />

            <TextBox Text="{Binding Path=Title, Mode=TwoWay, ValidatesOnDataErrors=True}"
                     Grid.Column="1" Grid.Row="1" />

            <ComboBox Grid.Column="1" Grid.Row="2"
                      ItemsSource="{Binding Path=Employees}"
                      SelectedItem="{Binding Path=SelectedEmployees, Mode=TwoWay, ValidatesOnDataErrors=True}"
                      DisplayMemberPath="ShortFio" />
        </Grid>
    </Grid>
</UserControl>
